module WindSpirit
{
    export class IButton extends egret.DisplayObjectContainer
    {
        public bmp: egret.Bitmap;
        public textField: egret.TextField;
        public constructor(text:string)
        {
            super();
            
            var bmp = new egret.Bitmap(RES.getRes("btn_png"));
            this.addChild(bmp);
            this.bmp = bmp;
            
            var textField = new egret.TextField;
            textField.size = 35;
            textField.textColor = 0xffffff;
            textField.text = text;
            textField.fontFamily = WindSpirit.Const.FONT_FAMILY;
            textField.anchorX = textField.anchorY = 0.5;
            textField.x = bmp.width >> 1;
            textField.y = bmp.height >> 1;
            this.addChild(textField);
            this.textField = textField;
            
            this.touchEnabled = true;
        }
    }
}